<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .color {
            background: orange;
        }
    </style>
    <script src="jquery-3.2.1.min.js"></script>
    <script>
        $(function () {
            var div = document.createElement('div');
            (document.body).appendChild(div);
            $('div').css({'width':'200px','height':'100px','border':'3px solid red','padding':'5px','margin':'10px'});
            var button = document.createElement('button');
            (document.body).appendChild(button);
            $('button').html('click').on('click',function () {
                $('div').toggleClass('color');
            })
        })
    </script>
</head>
<body>
</body>
</html>